import { createApp } from 'vue'
import App from './App.vue' // 根组件
import router from './router' // js文件命名为index时可省略/index.js
import store from './store'
import axios from 'axios'
import VueAxios from 'vue-axios'
axios.defaults.baseURL = "/api"//"/api";//全局后台接口
// 导入element-plus和css文件
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 实例化vue
const app=createApp(App)

// 导入图标并进行全局注册
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 挂载全局对象
app.config.globalProperties.$http = axios

app.use(store).use(router).use(VueAxios, axios).use(ElementPlus) // 注册插件

app.mount('#app')  // <div id="app">与此处的app对应

